<template>
    <div>
        <Table :columns="userCol" :data="userList" style="margin-top: 15px;"></Table>
    </div>
</template>
<script>
    import {userTask} from '@/api/train.js'
    import expandRow from './table-expand.vue';
    export default {
        components: { expandRow },
        data () {
            return {
                scenarioId:this.$route.query.id, // 训练id
                // 任务
                userTotal:0,
                userCol:[
                    {
                        type: 'expand',
                        width: 60,
                        render: (h, params) => {
                            return h(expandRow, {
                                props: {
                                    row: params.row.tasks
                                }
                            })
                        }
                    },
                    {
                        title:'队伍名称',
                        key:'teamName',
                        align:'center'
                    },
                    {
                        title:'队伍ID',
                        key:'teamId',
                        align:'center'
                    },
                ],
                userList:[],
                page:1,
                pageSize:10,
            }
        },
        created(){
            
        },
        mounted(){
            this.getUserTaskList()
        },
        methods:{
            // 学员完成任务情况
            getUserTaskList(){
                userTask(this.scenarioId)
                .then(res=>{
                    if(res.data.code === 1){
                        this.userList = res.data.data
                    }
                })
                .catch(err=>{
                    console.log(err)
                })
            },
        }
    }
</script>
<style scoped>
    
</style>

